Carbon


SoundComponentAddSource

Header: Sound.h Carbon status: Supported

Adds a new sound source.

ComponentResult SoundComponentAddSource (
    ComponentInstance ti, 
    SoundSource *sourceID
);
Parameter descriptions
ti

A component instance that identifies your sound component.

sourceID

On exit, a source ID for the newly created source component chain.

function result

Returns noErr if successful or an appropriate result code otherwise.

DISCUSSION

The SoundComponentAddSource function is called by the Sound Manager to create a new sound source. If your sound output device component can mix multiple channels of sound, it needs to define this function. Your SoundComponentAddSource function should call the Sound Manager function OpenMixerSoundComponent to create an new instance of the Apple Mixer component. The Apple Mixer component then creates a sound component chain capable of generating the type of data your sound output device component wants to receive.

The Apple Mixer also assigns a unique 4-byte source ID that identifies the new sound source and component chain. You can retrieve that source ID by calling the Apple Mixer’s SoundComponentAddSource function. Your SoundComponentAddSource function should then pass that source ID back to the Sound Manager in the sourceID parameter.

Most sound components do not need to implement the SoundComponentAddSource function. Only sound components that can handle more than one source of input need to define it.

SPECIAL CONSIDERATIONS

The SoundComponentAddSource function is called at noninterrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)